package com.xprime.mobileFramework.function;

import android.content.Context;
import android.widget.Toast;

import com.adobe.fre.FREContext;
import com.adobe.fre.FREFunction;
import com.adobe.fre.FREInvalidObjectException;
import com.adobe.fre.FREObject;
import com.adobe.fre.FRETypeMismatchException;
import com.adobe.fre.FREWrongThreadException;

public class ToastFREFunction implements FREFunction {

	@Override
	public FREObject call(FREContext pContext, FREObject[] pParams) {
		Context context = pContext.getActivity();
		try {
//			String actionScriptData = pContext.getActionScriptData().getAsString();
			
			String str2 =pParams[0].getAsString();
			
			Toast.makeText(context, str2, Toast.LENGTH_LONG).show();
			
			return FREObject.newObject("Toast success!!!!!!!");
		} catch (IllegalStateException e) {
			e.printStackTrace();
		} catch (FRETypeMismatchException e) {
			e.printStackTrace();
		} catch (FREInvalidObjectException e) {
			e.printStackTrace();
		} catch (FREWrongThreadException e) {
			e.printStackTrace();
		}
		return null;
	}


}
